package com.yidu.hbatsft.service.impl;

import com.yidu.hbatsft.dao.AtsSchemeAthleteMapper;
import com.yidu.hbatsft.domain.AtsSchemeAthlete;
import com.yidu.hbatsft.service.AtsSchemeAthleteService;
import com.yidu.privilege.Utils.Pages;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class AtsSchemeAthleteServiceImpl implements AtsSchemeAthleteService{

    @Resource
    AtsSchemeAthleteMapper atsSchemeAthleteMapper;

    /**
     * 查询所有
     * @param atsSchemeAthlete
     * @param pages
     *
     * @return
     */
    @Override
    public List<AtsSchemeAthlete> selectAll(AtsSchemeAthlete atsSchemeAthlete, Pages pages) {
        List<AtsSchemeAthlete> ats =  atsSchemeAthleteMapper.selectAll(atsSchemeAthlete,pages);

        return ats;
    }

    /**
     * 查询总行数
     * @param atsSchemeAthlete
     * @return
     */
    @Override
    public Long count(AtsSchemeAthlete atsSchemeAthlete) {
        Long  ats =  atsSchemeAthleteMapper.count(atsSchemeAthlete);
        return ats;
    }


    /**
     * 新增
     * @param record
     * @return
     */
    @Override
    public int insert(AtsSchemeAthlete record) {
        int  ats =  atsSchemeAthleteMapper.insert(record);
        return ats;
    }


    /**
     * 逻辑删除
     * @param saId
     * @return
     */
    @Override
    public int update(Integer saId) {
        int  ats =  atsSchemeAthleteMapper.update(saId);
        return ats;
    }


    /**
     * 根据id查询
     * @param saId
     * @return
     */
    @Override
    public AtsSchemeAthlete selectByPrimaryKey(Integer saId) {
        AtsSchemeAthlete ats =  atsSchemeAthleteMapper.selectByPrimaryKey(saId);
        return ats;
    }


    /**
     * 修改
     * @param record
     * @return
     */
    @Override
    public int updateByPrimaryKey(AtsSchemeAthlete record) {
        int ats =   atsSchemeAthleteMapper.updateByPrimaryKey(record);
        return ats;
    }


    /**
     * 模糊查询
     * @param newTitle
     * @return
     */
    @Override
    public List<AtsSchemeAthlete> selectVague(String newTitle) {
        List<AtsSchemeAthlete> ats =   atsSchemeAthleteMapper.selectVague(newTitle);
        return ats;
    }

    /**
     *
     * 根据方案id查询
     * @param schemeId
     * @return
     * 张雨虹
     */
    @Override
    public List<AtsSchemeAthlete> selectbyschemeidKF(Integer schemeId) {
        List<AtsSchemeAthlete> ats=  atsSchemeAthleteMapper.selectbyschemeidKF(schemeId);
        return ats;
    }

    /**
     * 根据方案id修改
     * @param record
     * @return
     * 张雨虹
     */
    @Override
    public int updateByPrimaryKeys(AtsSchemeAthlete record) {
        return atsSchemeAthleteMapper.updateByPrimaryKeys(record);
    }

    /**
     * 根据方案id逻辑删除
     * @param schemeId
     * @return
     * 张雨虹
     */
    @Override
    public int updatestate(Integer schemeId) {
        return atsSchemeAthleteMapper.updatestate(schemeId);
    }


    /**
     * 物理删除
     * @param schemeId
     * @return
     */
    @Override
    public int deletePhysics(Integer schemeId) {
        int rows =  atsSchemeAthleteMapper.deletePhysics(schemeId);
        return rows;
    }

    /**
     * 运动营养修改是否查看和查看时间
     */
    @Override
    public int updateByAthleteIdnu(AtsSchemeAthlete athlete) {
        int rows = atsSchemeAthleteMapper.updateByAthleteIdnu(athlete);
        return rows;
    }
}
